
/*****************************************************************************
 *
 * 作   者: 陈睿 * 创建时间: 2022/11/23 10:43:25 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';

/**
 *
 */
export class RepairApply extends DataPacket {
  Id: string; // 保修申请编号
  DeviceId: string; // 保修设备编号
  DeviceName: string; // 报修设备名字
  Phone: string; // 联系电话
  Type: number; // 保修类型(租客报修|交房报修)
  ApplicantId: string; // 报修客户编号
  Description: string; // 设备状况(设备状况图片链接)
  State: number; // 审核状态
  IsWithdraw: number; // 是否撤回申请（0否，1是）
  CreateDate: Date|undefined; // 申请日期
  UpdateDate: Date|undefined; // 修改日期

  constructor(options: Partial<RepairApply> = {}) {
    super();
    this.Id = options.Id || '';
    this.DeviceId = options.DeviceId || '';
    this.DeviceName = options.DeviceName || '';
    this.Phone = options.Phone || '';
    this.Type = !options.Type ? 0 : Number.parseFloat(options.Type.toString());
    this.ApplicantId = options.ApplicantId || '';
    this.Description = options.Description || '';
    this.State = !options.State ? 0 : Number.parseFloat(options.State.toString());
    this.IsWithdraw = !options.IsWithdraw ? 0 : Number.parseFloat(options.IsWithdraw.toString());
    this.CreateDate = this.newDate(options.CreateDate);
    this.UpdateDate = this.newDate(options.UpdateDate);
  }
}

/**
 * 列表
 */
export class RepairApplyList extends NorDataList<RepairApply> {

  constructor(options: Partial<RepairApplyList> | Array<RepairApply> = {}) {
    super(options, RepairApply);
  }
}

